<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
				xmlns:ui="http://java.sun.com/jsf/facelets"
				xmlns:h="http://java.sun.com/jsf/html"
				xmlns:a4j="http://richfaces.org/a4j"
				xmlns:rich="http://richfaces.org/rich"
				xmlns:f="http://java.sun.com/jsf/core"
				xmlns:c="http://java.sun.com/jstl/core"
				xmlns:t="http://myfaces.apache.org/tomahawk"
				template="/pages/search_template.xhtml"> 

	<ui:param name="crudBean" value="#{controleLogBaixaBean}" />
	
	<ui:define name="saveStateObjectsDefined">
		<t:saveState value="#{crudBean.listaEmpresas}" />
		<t:saveState value="#{crudBean.listaBandeiras}" />
		<t:saveState value="#{crudBean.listaRedeAdquirentes}" />
	</ui:define>
	
	<ui:define name="content">
		<!-- Painel de Pesquisa - Inicio -->
		<h:panelGroup id="panelGroupDePesquisa" rendered="#{crudBean.searching}">
			<f:subview id="viewBusca">
				<table>
					<tr>
						<td class="tdCor"><h:outputText value="#{bundle.lbl_periodo_vendas}"/> </td>
						<td class="tdBranco">
							<rich:calendar value="#{crudBean.searchObject.filtro.dataVendaInicial}" datePattern="dd/MM/yyyy" cellWidth="24px" cellHeight="22px" style="width:200px" showWeeksBar="false" inputSize="10" converter="dataConverter" oninputkeypress="formataData(this, event);" maxlength="10" onkeypress="soNumero(this);" enableManualInput="true"/>
							<h:outputText value=" #{bundle.lbl_ate} "/>
							<rich:calendar value="#{crudBean.searchObject.filtro.dataVendaFinal}" datePattern="dd/MM/yyyy" cellWidth="24px" cellHeight="22px" style="width:200px" showWeeksBar="false" inputSize="10" converter="dataConverter" oninputkeypress="formataData(this, event);" maxlength="10" onkeypress="soNumero(this);" enableManualInput="true"/>
						</td>
					</tr>
					<tr>
						<td class="tdCor"><h:outputText value="#{bundle.lbl_periodo_pagamento}"/> </td>
						<td class="tdBranco">
							<rich:calendar value="#{crudBean.searchObject.filtro.dataPagamentoInicial}" datePattern="dd/MM/yyyy" cellWidth="24px" cellHeight="22px" style="width:200px" showWeeksBar="false" inputSize="10" converter="dataConverter" oninputkeypress="formataData(this, event);" maxlength="10" onkeypress="soNumero(this);" enableManualInput="true"/>
							<h:outputText value=" #{bundle.lbl_ate} "/>
							<rich:calendar value="#{crudBean.searchObject.filtro.dataPagamentoFinal}" datePattern="dd/MM/yyyy" cellWidth="24px" cellHeight="22px" style="width:200px" showWeeksBar="false" inputSize="10" converter="dataConverter" oninputkeypress="formataData(this, event);" maxlength="10" onkeypress="soNumero(this);" enableManualInput="true"/>
						</td>
					</tr>
					<tr>
						<td class="tdCor" width="20%"><h:outputText value="#{bundle.lbl_empresa}"/> </td>
						<td class="tdBranco">
							<h:selectOneMenu value="#{crudBean.searchObject.estEmpresaVo.codigo}" converter="simpleIndexConverter">
    							<t:selectItems var="o" itemValue="#{o.codigo}" itemLabel="#{o.descricao}" value="#{crudBean.listaEmpresas}" />
    						</h:selectOneMenu>
						</td>
					</tr>
					<tr>
						<td class="tdCor" width="20%"><h:outputText value="#{bundle.lbl_rede_adquirente}"/> </td>
						<td class="tdBranco">
							<h:selectOneMenu value="#{crudBean.searchObject.redeAdquirenteVo.codigo}" converter="simpleIndexConverter">
    							<t:selectItems var="o" itemValue="#{o.codigo}" itemLabel="#{o.descricao}" value="#{crudBean.listaRedeAdquirentes}" />
    						</h:selectOneMenu>
						</td>
					</tr>
					<tr>
						<td class="tdCor" width="20%"><h:outputText value="#{bundle.lbl_bandeira}"/> </td>
						<td class="tdBranco">
							<h:selectOneMenu value="#{crudBean.searchObject.bandeiraVo.codigo}" converter="simpleIndexConverter">
    							<t:selectItems var="o" itemValue="#{o.codigo}" itemLabel="#{o.descricao}" value="#{crudBean.listaBandeiras}" />
    						</h:selectOneMenu>
						</td>
					</tr>
					
				</table>
			</f:subview>
		</h:panelGroup>
		<!-- Painel de Pesquisa - Fim -->
		
	</ui:define>
	
	<ui:define name="list">
		<h:panelGroup id="panelGroupDeListagem" rendered="#{crudBean.searching}">
			<f:subview id="viewListagem">
				<rich:dataTable id="tblData" value="#{crudBean.searchResult}" binding="#{crudBean.tblData}" var="rst" style="width: 100%;" rowClasses="par,impar">
               		
               		<rich:column style="text-align: left;" sortBy="#{rst.estEmpresaVo.descricaoReduzida}">
						<f:facet name="header">
							<h:outputText value="#{bundle.lbl_empresa}" />
						</f:facet>
						<h:outputText value="#{rst.estEmpresaVo.descricaoReduzida}"/>
					</rich:column>
               		<rich:column style="text-align: left;" sortBy="#{rst.redeAdquirenteVo.descricao}">
						<f:facet name="header">
							<h:outputText value="#{bundle.lbl_rede_adquirente}" />
						</f:facet>
						<h:outputText value="#{rst.redeAdquirenteVo.descricao}"/>
					</rich:column>
               		<rich:column style="text-align: left;" sortBy="#{rst.lojaVo.estLojaVo.descricao}">
						<f:facet name="header">
							<h:outputText value="#{bundle.lbl_loja}" />
						</f:facet>
						<h:outputText value="#{rst.lojaVo.estLojaVo.descricao}"/>
					</rich:column>
               		<rich:column style="text-align: left;" sortBy="#{rst.bandeiraVo.descricao}">
						<f:facet name="header">
							<h:outputText value="#{bundle.lbl_bandeira}" />
						</f:facet>
						<h:outputText value="#{rst.bandeiraVo.descricao}"/>
					</rich:column>
               		<rich:column style="text-align: left;" sortBy="#{rst.arquivoVo.descricao}">
						<f:facet name="header">
							<h:outputText value="#{bundle.lbl_arquivo}" />
						</f:facet>
						<h:outputText value="#{rst.arquivoVo.descricao}"/>
					</rich:column>
               		<rich:column style="text-align: center;" sortBy="#{rst.dataVendaVo.data}">
						<f:facet name="header">
							<h:outputText value="#{bundle.lbl_data_venda}" />
						</f:facet>
						<h:outputText value="#{rst.dataVendaVo.data}"/>
					</rich:column>
               		<rich:column style="text-align: center;" sortBy="#{rst.dataPagamentoVo.data}">
						<f:facet name="header">
							<h:outputText value="#{bundle.lbl_datapagamento}" />
						</f:facet>
						<h:outputText value="#{rst.dataPagamentoVo.data}"/>
					</rich:column>
               		<rich:column style="text-align: right;" sortBy="#{rst.valorAPagar}">
						<f:facet name="header">
							<h:outputText value="#{bundle.lbl_valor_a_pagar}" />
						</f:facet>
						<h:outputText value="#{rst.valorAPagar}"/>
					</rich:column>
               		<rich:column style="text-align: right;" sortBy="#{rst.valorPago}">
						<f:facet name="header">
							<h:outputText value="#{bundle.lbl_valor_pago}" />
						</f:facet>
						<h:outputText value="#{rst.valorPago}"/>
					</rich:column>
               		<rich:column style="text-align: right;" sortBy="#{rst.valorDiferenca}">
						<f:facet name="header">
							<h:outputText value="#{bundle.lbl_valor_diferenca}" />
						</f:facet>
						<h:outputText value="#{rst.valorDiferenca}"/>
					</rich:column>
               		<rich:column style="text-align: right;" sortBy="#{rst.numeroResumoVenda}">
						<f:facet name="header">
							<h:outputText value="#{bundle.lbl_nsu}" />
						</f:facet>
						<h:outputText value="#{rst.numeroResumoVenda}"/>
					</rich:column>
					
					<f:facet name="footer">
                       	<rich:columnGroup rendered="#{crudBean.searching}">
                       		<rich:column colspan="7" style="text-align: right;">
					     		<h:outputText value="#{bundle.lbl_total}" />
			 		    	</rich:column>
                           	<rich:column style="text-align: right;">
                               	<h:outputText value="#{crudBean.valorTotalAPagar}"/>
                           	</rich:column>
                           	<rich:column style="text-align: right;">
                               	<h:outputText value="#{crudBean.valorTotalPago}"/>
                           	</rich:column>
                           	<rich:column style="text-align: right;">
                               	<h:outputText value="#{crudBean.valorTotalDiferenca}"/>
                           	</rich:column>
                           	<rich:column style="text-align: right;">
                               	<h:outputText value=""/>
                           	</rich:column>
                       	</rich:columnGroup>
                    </f:facet>
				</rich:dataTable>
			</f:subview>
		</h:panelGroup>
	</ui:define>
	
</ui:composition>